#include <bits/stdc++.h>

#include "tree.h"
using namespace std;
vector<vector<int>> res;  //所有的路径

/**
 * @brief Get the Path object
 * 返回所有从根节点到叶子节点的路径。：https://leetcode-cn.com/problems/binary-tree-paths/
 * @param root
 * @param path
 */
void getPath(TreeNode* root, vector<int>& path) {
  if (root == nullptr) {
    return;
  }

  path.push_back(root->val);

  if (root->left == nullptr && root->right == nullptr) {
    res.emplace_back(path);
  }

  vector<int> left_path = path;
  getPath(root->left, left_path);

  vector<int> right_path = path;
  getPath(root->right, right_path);
}

vector<string> binaryTreePaths(TreeNode* root) {
  if (root == nullptr) {
    return {};
  }
  vector<int> path;
  getPath(root, path);
}
